//
//  SearchAtHomeViewController.m
//  ZooNgonDoiOS
//
//  Created by Trung sound on 9/4/12.
//  Copyright (c) 2012 Personal. All rights reserved.
//

#import "SearchAtHomeViewController.h"

@implementation SearchAtHomeViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        [self initHeaderView];
    }
    return self;
}

- (void) initHeaderView {
    _vHeader = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 48)];
    _vHeader.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:IMG_NAV_BACKGROUND]];
    
    _btnBack = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 48, 48)];
    [_btnBack setBackgroundImage:[UIImage imageNamed:IMG_BACK_NORMAL] forState:UIControlStateNormal];
    [_btnBack setBackgroundImage:[UIImage imageNamed:IMG_BACK_SELECTED] forState:UIControlStateHighlighted];
    [_btnBack addTarget:self action:@selector(backClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    
    _btnFilter = [[UIButton alloc] initWithFrame:CGRectMake(self.view.bounds.size.width * 3/4, 0, self.view.bounds.size.width/4, 48)];
        //    [_btnCheckIn setBackgroundImage:[UIImage imageNamed:IMG_CHECKIN_NORMAL] forState:UIControlStateNormal];
        //    [_btnCheckIn setBackgroundImage:[UIImage imageNamed:IMG_CHECKIN_SELECTED] forState:UIControlStateHighlighted];
    
    [_btnFilter addTarget:self action:@selector(pushPickFoodScreen) forControlEvents:UIControlEventTouchUpInside];
    
    [_btnFilter setTitle:STRING_BTN_FILTER forState:UIControlStateNormal];
    [_btnFilter setFont:[UIFont boldSystemFontOfSize:15]];
    
    [_vHeader addSubview:_btnBack];
    [_vHeader addSubview:_btnFilter];
    
    [self.view addSubview:_vHeader];
    
    [_btnBack release];
    [_btnFilter release];
    [_vHeader release];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
}
*/

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
}
*/

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
